package com.supermap.common.controller;

import com.supermap.common.JSONUtil;
import com.supermap.common.service.CropService;
import com.supermap.common.service.SuggestionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author:langhongshuai
 * @Description:反馈的意见接口表
 * @Date:18/3/12 上午11:53
 */
@Controller
@RequestMapping("SuggestionController")
public class SuggestionController {

    /**
     * 使用指定类初始化日志对象，在日志输出的时候，可以打印出日志信息所在类
     */
    protected static final Logger logger = LoggerFactory.getLogger(SuggestionController.class);

    @Autowired
    private SuggestionService suggestionService;


    /**
     * 保存反馈的意见
     * @param request
     * @return
     */
    @RequestMapping("saveSuggestion")
    @ResponseBody
    public JSONUtil saveSuggestion(HttpServletRequest request){
        String comment = request.getParameter("comment");
        String userId = request.getParameter("userId");

        return suggestionService.saveSuggestion(comment,userId);
    }
}
